<?php  $this->load->view('admin/software/link_bar');?>
		<form method="post" action="<?php echo site_url('admin/tab/delete')?>" class="form">
		<div class="box_function">
		<table width="747" border="0" cellpadding="0" cellspacing="0" class="listproduct" id="listproduct">
				<tr>
					<td width="15" class="tilte_list_pro">
						<input name="checkme" class="noborder" onclick="checkDelBoxes(this.form, 'categoryBox[]', this.checked)" type="checkbox">
					</td>
					
					<td width="70" class="tilte_list_pro">
						Logo
					</td>
					<td width="100" class="tilte_list_pro">
						<?php echo lang('name');?>
					</td>
					<td width="70" class="tilte_list_pro">
						<?php echo lang('link_to');?>
					</td>
					<td width="70" class="tilte_list_pro">
						<?php echo lang('position');?>
					</td>
					<td width="40" class="tilte_list_pro">
						<?php echo lang('order_view');?>
					</td>
					<td width="10" class="tilte_list_pro">
						<?php echo lang('active');?>
					</td>
					<td class="tilte_list_pro" style="width: 80px;">
						<?php echo lang('action');?>
					</td>
				</tr>
				<?php
					if(count($rows)>0){
						for($i = 0; $i < count($rows); $i++){
							$id = $rows[$i]->id_adv;
							$image = $rows[$i]->image;
							$name = $rows[$i]->name;
							$link_to = $rows[$i]->link_to;
							$position = trim($rows[$i]->position);
							$order_view = $rows[$i]->order_view;
							$min_position =  $rows[$i]->min_order;
							$max_position = $rows[$i]->max_order;
							//$num_child = 0; //$rows[$i]->num_child;
							$id_next = $rows[$i]->id_next;
							$id_preview = $rows[$i]->id_preview;
							$order_view = $rows[$i]->order_view;
							$enlable = $rows[$i]->active == 1 ? 'checked.jpg' : 'nocheck.jpg';

                            if($i % 2 == 0) $css_class = 'row1';
                            else $css_class = 'row2';

						?>
					<tr onMouseOver="" class="<?php echo $css_class ?>">
					<td class="product center">
						<input name="categoryBox[]" value="<?php echo $id?>" class="noborder" type="checkbox">
                        </td>
					
	
					<td class="product" onclick="document.location = '#'">
					<img src="<?php echo base_url(). $image?>" width="100px" height="60px" />
					</td>
					<td class="pointer" onclick="document.location = '#'">
					<?php 
					
					echo $name;
					?>
					</td>
					<td class="product" onclick="document.location = '#'">
					<?php echo $link_to ?>
					</td>
					<td class="product" onclick="document.location = '#'">
                    <input type="radio" onclick="xajax_changePosition(<?php echo $id?>, 'left');" <?php echo $position=='left'?'checked':'' ?> name="r<?php echo $id?>"><?php echo lang('left')?><br>
                    <input type="radio" onclick="xajax_changePosition(<?php echo $id?>, 'right');" <?php echo $position=='right'?'checked':'' ?> name="r<?php echo $id?>"><?php echo lang('right')?><br>
                    <input type="radio" onclick="xajax_changePosition(<?php echo $id?>, 'center');" <?php echo $position=='center'?'checked':'' ?> name="r<?php echo $id?>"><?php echo lang('center')?><br>
                    <input type="radio" onclick="xajax_changePosition(<?php echo $id?>, 'bottom');" <?php echo $position=='bottom'?'checked':'' ?> name="r<?php echo $id?>"><?php echo lang('bottom')?>
					</td>
					<td class="product center" onclick="document.location = '#'">
					<?php if($id_next/*$order_view < $max_position AND isset($rows[$i+1])*/){?>
						<a href="<?php echo site_url('admin/software/change_order/'.$id.'/'.$id_next)?>">
							<img src="<?php echo base_url()?>images/admin/down.gif" alt="Up" title="Up" border="0">
						</a>
					<?php } 
						if($id_preview/*$order_view > $min_position AND isset($rows[$i-1])*/){
					?>
						<a href="<?php echo site_url('admin/software/change_order/'.$id.'/'.$id_preview)?>">
							<img src="<?php echo base_url()?>images/admin/up.gif" alt="Down" title="Down" border="0">
						</a>
					<?php } ?>
					
					</td>
					<td class="product" onclick="document.location = '#'">
					<img src="<?php echo base_url().'images/'.$enlable?>">
					</td>
					<td class="product center">
						
						<a href="<?php echo site_url('admin/software/edit/' . $id)?>">
							<img src="<?php echo base_url()?>images/admin/edit.gif" alt="Edit" title="Edit" border="0">
						</a>
	
						<a href="<?php echo site_url('admin/software/delete/'. $id)?>" onclick="return confirm('Delete item #<?php echo $id?>?');">
						<img src="<?php echo base_url()?>images/admin/delete.gif" alt="Delete" title="Delete" border="0">
						</a>
					</td>
				</tr>
						<?php
						}
					}
					?>
					
			<tr>
			<td colspan="10">
			
			<p>
			<input class="button" name="submitDelcategory" value="Delete selection" onclick="return confirm('Delete selected items?');" type="submit">
			</p>
			
		</td>
	</tr>
</table>
</div>
		</form>
		<?php echo $this->pagination->create_links();?>